import { defineStore } from 'pinia'

//创建小仓库
const useUserStore = defineStore('User', {
    state: () => {
        return {
            activeTab: 0 ,// 默认选中的索引
            socketTask:null,
            unreadMessageNumber: 0, // 默认选中的索引
            keyboardHeight: 0, // 默认选中的索引: false, // 默认选中的索引
        }
    },
    actions: {
        //设置active的值
        setActive(active) {
            this.activeTab = active
        },
       setSocketTask(task) {
            this.socketTask = task
        },
        //设置unreadMessageNumber的值
        setUnreadMessageNumber(number) {
            this.unreadMessageNumber = number
        }
    }
})

//暴露小仓库
export default useUserStore
